<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<h2>localstore</h2>
<button onclick="saveDate()">保存数据到本地</button>
<hr>
<button onclick="getDate()">获取数据</button>

<script type="text/javascript">

    function saveDate() {
        localStorage.setItem("halk", "heloo");
        localStorage.setItem("halk2", "helo2222o");
    }

    function getDate(key) {
        let item = localStorage.getItem("halk");
        alert(item)
    }
</script>

</body>
</html>
